#pragma once
#include <vector>
#include "../../nclgl/SceneNode.h"
#include "Constraint.h"
#include "../../nclgl/Vector3.h"


class SpringNet:public Constraint{
public:
	SpringNet();
	~SpringNet(){};

	void Update(float msec);
	void NodeUpdate(float msec);
	float randFloat(int start, int end);
	void SetTarget(SceneNode* scNode){ target = scNode; };

	std::vector<Vector3> positions;
	std::vector<Vector3> origPos;
	std::vector<Vector3> localPos;
	std::vector<Vector3> velocities;
	std::vector<Vector3> forces;
	int numBalls;

private:
	SceneNode* target;
	Vector3 spScale;
	float mass;
	float ks;
	float kd;
	int initPos;
};